package cn.unknowpupil.init.domain.dto;

import com.google.common.collect.Lists;
import lombok.Data;

import java.util.List;

/**
 * Created at 2020/11/25 by w10g <br>
 * Initialize PermissionNode ... <br>
 *
 * @author unknowpupil
 * @since 0.0.1
 */
@Data
public class PermissionNode {
    private Long id;
    private Long parentId;
    private String fullId;
    private String label;
    private String code;
    private Integer showOrder;
    private List<PermissionNode> children;

    public PermissionNode(){}

    public PermissionNode(Long id, Long parentId, String label) {
        this.id = id;
        this.parentId = parentId;
        this.label = label;
    }

    public List<PermissionNode> getChildren() {
        if (children == null) {
            children = Lists.newArrayList();
        }
        return children;
    }
}
